import time

from  selenium import webdriver
from  selenium.webdriver.common.by import By

# 获取驱动
driver = webdriver.Edge()
# 通过驱动打开网页
driver.get("http://www.baidu.com")
time.sleep(2)
# driver.find_elements("tag name","a")
elements = driver.find_elements(By.TAG_NAME,"a")
print(elements)
print(type(elements))
for e in elements:
    print(e.text) # 获取标签内容
    print(e.get_attribute("href"),'------') # 获取href属性




